﻿@namespace MudBlazor.Charts
@inherits MudChartBase

@if (MudChartParent?.ChartOptions.DisableLegend != true)
{
    <div @attributes="UserAttributes" class="mud-chart-legend">
        @foreach (var item in Data)
        {
            <div class="mud-chart-legend-item">
                <span class="mud-chart-legend-marker" style="@($"background-color:{MudChartParent.ChartOptions.ChartPalette.GetValue(item.Index % ChartOptions.ChartPalette.Count())}")"></span>
                <MudText Typo="Typo.body2" Inline="true">@item.Labels</MudText>
            </div>
        }
    </div>
}
